import { createRouter, createWebHistory } from "vue-router";
import HomeView from "../views/HomeView.vue";

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: "/",
      redirect: "/Login"
    },
    {
      path: "/Login",
      name: "Login",
      component: () => import("../views/Login.vue")
    },
    {
      path: "/admin",
      component: () => import("../views/admin.vue"),
      children: [
        {
          path: "Banner",
          name: "Banner",
          component: () => import("../views/Banner/BannerList.vue"),
        },
        {
          path: "Pro",
          name: "Pro",
          component: () => import("../views/Pro.vue"),
        },
        {
          path: "SecondsKill",
          name: "SecondsKill",
          component: () => import("../views/SecondsKill.vue"),
        },
        {
          path: "Recommend",
          name: "Recommend",
          component: () => import("../views/Recommend.vue"),
        },
        {
          path: "Search",
          name: "Search",
          component: () => import("../views/Search.vue"),
        }
      ]
    }
  ],
});

export default router;
